-- [tsx]: Transition.tsx
local ____exports = {} -- 1
local ____Dora = require("Dora") -- 3
local Color = ____Dora.Color -- 3
local DrawNode = ____Dora.DrawNode -- 3
local Node = ____Dora.Node -- 3
local Vec2 = ____Dora.Vec2 -- 3
local cycle = ____Dora.cycle -- 3
local thread = ____Dora.thread -- 3
local ____config = require("Script.config") -- 4
local designSize = ____config.designSize -- 4
____exports.Transition = function(props) -- 14
	local ____props_0 = props -- 21
	local root = ____props_0.root -- 21
	if root == nil then -- 21
		root = Node() -- 16
	end -- 16
	local color = ____props_0.color -- 16
	if color == nil then -- 16
		color = Color(4278190080) -- 17
	end -- 17
	local time = ____props_0.time -- 17
	if time == nil then -- 17
		time = 1 -- 18
	end -- 18
	local ____type = ____props_0.type -- 18
	if ____type == nil then -- 18
		____type = 0 -- 19
	end -- 19
	local waittime = ____props_0.waittime -- 19
	if waittime == nil then -- 19
		waittime = 1 -- 20
	end -- 20
	local drawnode = DrawNode() -- 23
	root:addChild(drawnode) -- 24
	drawnode.order = 1 -- 25
	local tempcolor = Color(color:toARGB()) -- 26
	thread(function() -- 27
		cycle( -- 28
			time, -- 28
			function(scale) -- 28
				if ____type == -1 then -- 28
					tempcolor.a = math.floor(color.a * (1 - scale)) -- 30
				elseif ____type == -1 then -- 30
					tempcolor.a = math.floor(color.a * scale) -- 32
				else -- 32
					if scale < 0.5 then -- 32
						tempcolor.a = math.floor(color.a * (scale * 2)) -- 35
					else -- 35
						tempcolor.a = math.floor(color.a * (2 - 2 * scale)) -- 37
					end -- 37
				end -- 37
				drawnode:clear() -- 39
				drawnode:drawPolygon( -- 40
					{ -- 40
						Vec2(designSize.width / 2, designSize.height / 2), -- 40
						Vec2(-designSize.width / 2, designSize.height / 2), -- 40
						Vec2(-designSize.width / 2, -designSize.height / 2), -- 40
						Vec2(designSize.width / 2, -designSize.height / 2) -- 40
					}, -- 40
					tempcolor -- 40
				) -- 40
				if scale == 1 then -- 40
					root:removeChild(drawnode) -- 42
				end -- 42
			end -- 28
		) -- 28
	end) -- 27
	cycle( -- 46
		waittime, -- 46
		function(a) -- 46
		end -- 46
	) -- 46
end -- 14
return ____exports -- 14